@extends('layout.admin')

@section('title', '权限管理')


@section('content')
    <style>
        .list-content{
            background-color: #fff;
            max-width: 100%;
            flex: 0 0 100%;
            padding: 0 10px;
        }

        .list-content .list-table{
            padding-left: 18px;
            padding-right: 18px;
            max-width: 100%;
            overflow-x: auto;
        }

        .list-content .list-table .table{
            min-width: 850px;
        }

    </style>
    <div class="list-content">
        {{--头部--}}
        @include('shared.adminListHeader',[
        'listName'=>'角色列表',
        'svgIconName' => 'person-lines-fill',
        'listAddUrl' => url('admin/role/editRole'),
        ])

        {{--列表头部--}}
        @include('shared.adminListTableHeader', [
            'searchData' => isset($searchData) ? $searchData : [],//搜索值
            'listObject' => isset($listObject) ? $listObject : new stdClass,//数据对象
            'currentWebsite' => url('admin/role/index'),//返回当前列表的url
            'listTableActionsUrl' => url('admin/role/actionsRole'),//批量操作url
            'searchForm' => 'admin.role.search.role',//头部自定义搜索
            'batchActions' => 'shared.adminListHeaderActions',//头部自定义批量操作选项
        ])


        <div class="list-table">
            <form id="listTableForm">
            <table class="table table-bordered">
                <thead class="thead-dark">
                    <tr>
                        <th scope="col" style="width: 40px;"><input type="checkbox" class="" id="listCheckboxIds"></th>
                        <th scope="col" style="width: 80px;">id</th>
                        <th scope="col" style="width: 100px;">角色名称</th>
                        <th scope="col" style="width: 100px;">角色状态</th>
                        <th scope="col" style="width: 120px;">修改日期</th>
                        <th scope="col" style="width: 120px;">创建日期</th>
                        <th scope="col" style="width: 200px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                @if(isset($listObject))
                    @foreach($listObject as $listVal)
                        @if(1 != $listVal->is_administrator['value'])
                        <tr>
                            <td style="width: 40px;">
                                <input type="checkbox" class="" name="ids[]" value="{{$listVal->id}}">
                            </td>
                            <td style="width: 80px;">
                                {{$listVal->id}}
                            </td>
                            <td style="width: 100px;">{{$listVal->name}}</td>
                            <td style="width: 100px;">{{$listVal->status['name']}}</td>
                            <td style="width: 120px;">{{$listVal->updated_at}}</td>
                            <td style="width: 120px;">{{$listVal->created_at}}</td>
                            <td style="width: 200px;">
                                <a href="{{url('admin/role/deleteRole')}}">删除</a>
                                <a href="{{url('admin/role/editRole')}}">修改</a>
                                <a href="{{url('admin/role/editRules', ['id'=>$listVal->id])}}">规则</a>

                            </td>
                        </tr>
                        @endif
                    @endforeach
                @else
                    <tr>
                        <td colspan="7" class="text-muted" style="text-align: center;font-size: 20px;padding: 20px 0;">
                            暂无数据
                        </td>

                    </tr>
                @endif

                </tbody>
            </table>
            </form>
        </div>
    </div>

@endsection
